<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="orderCode" value="${param.orderCode}"></c:set>
<div class="easyui-layout" style="width:100%;height:100%;" fit="true">
    <div data-options="region:'center',title:'',split:true" style="height:100%;">
		<form id="buyerInfoForm" method="post" >
			<table class="detailTable"> 
    	 	<tr>
                <th>订单号:</th> 
                <td>
                	<input class="easyui-validatebox " value="${orderCode }" id="orderCode" name="orderCode" readonly="readonly" data-options="required:true"></td>
                </tr>
                <tr>
                <th>查询结果:</th>
                    <td>
                	  <input class="easyui-validatebox " id="resultMsg" name="resultMsg"  readonly="readonly">
                	</td>
                </tr>
                <tr>
                <th>银行流水号:</th>
                    <td>
                	  <input class="easyui-validatebox " id="tranSerialNo" name="tranSerialNo"  readonly="readonly">
                	</td>
                </tr>
                <tr>
                <th>订单状态:</th>
                    <td>
                	  <input class="easyui-validatebox " id="strStatus" name="strStatus"  readonly="readonly">
                	  <input type="hidden" id="status" name="status">
                	  <input type="hidden" id="feeDate" name="feeDate">
                	  <input type="hidden" id="orderType" name="orderType">
                	</td>
                </tr>
                <tr>
                <th>支付金额:</th>
                    <td>
                	  <input class="easyui-validatebox " id="feeAmount" name="feeAmount"  readonly="readonly">
                	</td>
                </tr>
            <tr id="cz" style="display: none">
                <th>操作:</th>
                <td>
                	<input type="button"  onclick="submitForm()" class="button" value="人工处理" >
                </td>
            </tr>
          </table>
       </form>
   </div>
</div>
<script>
$(function(){
	var param = {"orderCode":${orderCode }};
	$.pmsAjax({
		url:'<c:url value="/allinPay/inquiryAllinPayInfo.do"/>',
		data:param,
		success:function(data){
			var resultMsg = data.data.resultMsg;	
			var isSuccess = data.data.isSuccess;
			console.log(data);
			if(data.code=="200"){
				$("#resultMsg").val(resultMsg);
				$("#tranSerialNo").val(data.data.result.paymentOrderId);
				$("#status").val(data.data.result.status);
				$("#strStatus").val(data.data.result.strStatus);
				$("#feeDate").val(data.data.feeDate);
				$("#feeAmount").val(data.data.feeAmount);
				$("#orderType").val(data.data.orderType);
				//$("#cz").show();
				if(isSuccess == true){
					$("#cz").show();
				}
			}else{
				alertError(data.result);
			}	
		}
});
});

function submitForm(){
	$('#buyerInfoForm').form('submit', {
		url:'<c:url value="/ordercheck/updateOrder.do"/>',
	    onSubmit: function(param){
	    	if(!$("#buyerInfoForm").form('validate')){
	    		return false;
	    	}
	    	//alert(url);
	    	//时间对比
	    }, 
	    success:function(data){
		    var ret = eval("("+data+")");
	     	if(ret.code=='200'){
	     		alertShow("人工处理订单成功！");
	     		parent.ordersTable.refresh();
	     		parent.$("#win_order_status").dialog('close');
		    }else{
		    	alertError(ret.result);
			}
	    }
	});
}
</script>